﻿using System;
using System.Collections.Generic;
using System.Text;
using UnityEngine;
using Common;
public class ActionGUI
{
    public GUIModule Module;
    public ActionGUI(GUIModule module)
    {
        Module = module;
        Module.OnScreenChange += delegate(int width, int height)
        {
            for (int i = 0; i < defaultRects.Length; i++)
            {
                rects[i].xMin = defaultRects[i].xMin * Module.WidthScale;
                rects[i].yMin = defaultRects[i].yMin * Module.HeightScale;
                rects[i].width = defaultRects[i].width * Module.WidthScale;
                rects[i].height = defaultRects[i].height * Module.HeightScale;
            }
        };
    }
    public void Update()
    {

    }
    public void FixedUpdate()
    {

    }
    public void OnGUI()
    {
        //if (ownerTag != null)
        //{
        //    GUI.DrawTexture(rects[1], ownerTag.HeadIcon);
        //    GUI.DrawTexture(rects[0], BackIcon);
        //    GUI.DrawTexture(rects[2], HpIcon);
        //    GUI.DrawTexture(rects[3], MpIcon);
        //}
    }
    private Texture BackIcon;
    private Texture ActionIcon;
    private Rect[] defaultRects = new Rect[]
    {
        new Rect(5, 5, 193, 84),//new Rect(5, 5, 191, 78),
        new Rect(22, 20, 55, 55),//new Rect(35, 10, 64, 64),
        new Rect(89, 46, 92, 12),//new Rect(103, 32, 87, 10),
        new Rect(89, 65, 92, 12),//new Rect(103, 45, 87, 10),
        new Rect(95, 25, 100, 25)
    };
    public Rect[] rects = new Rect[]
    {
        new Rect(0, 0, 0, 0),
        new Rect(0, 0, 0, 0),
        new Rect(0, 0, 0, 0),
        new Rect(0, 0, 0, 0),
        new Rect(0, 0, 0, 0)
    };

}

